from flask import Flask
from blinker import Namespace

app = Flask(__name__)

@app.route('/')
def index():
    return 'Hello'

# 1.定义信号
space = Namespace()
fire_signal = space.signal('发送一个信号')
# 2.监听信号
def start_fire(sender):
    print('开火')
fire_signal.connect(start_fire)
# 3.发送信号
fire_signal.send()

if __name__ == '__main__':
    app.run(debug=True)